﻿<form name="myForm">
    
    <div class="control-group" ng-class="{error: myForm.name.$invalid}">
        <label>Name</label>
        <input type="text" name="name" ng-bind="name" required ng-model="inventoryItem.name" />
        <span ng-show="myForm.name.$error.required" class="help-inline">Required</span>
        <label ng-show="inventoryItem.id">Count</label>
        <span ng-show="inventoryItem.id">{{inventoryItem.currentCount}}</span>

    </div>

    <br>
    <a href="#/" class="btn">Cancel</a>
    
    <button ng-click="save()" ng-disabled="isClean() || myForm.$invalid" class="btn btn-primary">{{createRenameLabel}}</button>
    <button ng-click="deactivate()" ng-show="inventoryItem.id" class="btn btn-danger">De-Activate</button>
    
   <span ng-bind="error" class="help-inline"></span>

    <hr ng-show="inventoryItem.id"/>
    
    <label ng-show="inventoryItem.id"># of items</label>
    <input type="text" name="name" ng-show="inventoryItem.id" ng-bind="currentCount" ng-model="changeCount" width="20" />
    
    <button ng-click="checkin()" ng-show="inventoryItem.id" ng-disabled="isClean()">Check-in</button>
    <button ng-click="checkout()" ng-show="inventoryItem.id" ng-disabled="isClean()">Check-out</button>

</form>
